package io.renren.modules.pet.enums;

import lombok.Getter;

@Getter
public enum PetStatusEnum {
    STATUS_0(0, "待领养"),
    STATUS_1(1, "待签收"),
    STATUS_6(2, "已领养");

    private Integer index;
    private String chn;

    PetStatusEnum(Integer index, String chn) {
        this.index = index;
        this.chn = chn;
    }

    /**
     * 通过索引获取中文表示
     * @param index
     * @return
     */
    public static String getChnByIndex (Integer index) {
        PetStatusEnum[] petBreedEnums = PetStatusEnum.values();
        for (PetStatusEnum petBreedEnum : petBreedEnums) {
            if (petBreedEnum.index.equals(index)) {
                return petBreedEnum.chn;
            }
        }
        return null;
    }
}
